package com.trkj.controller;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.trkj.service.YzrPurchPlanService;
import com.trkj.vo.Result;

@Controller
public class YzrApprovalController {

	@Autowired
	private YzrPurchPlanService yzrPurchPlanService;
	
	@RequestMapping("/to_yzrApproval")
	public String toApproval(){
		return "yzr_approval";
	}
	
	
	
	//根据当前登录的用户，查找出待该用户审批的采购计划
	@RequestMapping("/queryPurPlanByLoginUser_yzr")
	public @ResponseBody Map<String, Object> queryPurchPlanByLoginUser(int page,int rows,Long staffId){
		return yzrPurchPlanService.queryPurchPlanByLoginUser(page, rows, staffId);				
	}
	
	//审批采购计划，保存数据
	@RequestMapping("/approvalPlan_yzr")
	public @ResponseBody Result approvalPlan(String shenpiState, String remark, String planId){
		System.err.println("状态："+shenpiState);
		System.err.println("备注："+remark);
		System.err.println("id："+planId);
		yzrPurchPlanService.approvalPlan(shenpiState, remark, planId);
		return new Result();
	}
}
